import java.util.Comparator;

//有一个类，实现了comparator接口，重写了compare
class Student{
    public int age;
}

public class TestDemo2 {
    public static void main(String[] args) {

        new Comparator<Student>(){
            @Override
            public int compare(Student o1, Student o2) {
                return o1.age-o2.age;
            }
        };

        Comparator<Student> comparator=new Comparator<Student>() {
            @Override
            public int compare(Student o1, Student o2) {
                return o1.age-o2.age;
            }
        };

    }
}
